From 792c98fdf60c07a4635b3d9e6c3ca0e2565cd681 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 5 Oct 2005 14:10:49 +0100 Subject: [PATCH] Handle the case where there are no spaces or parameters after the image name on the command line. Signed-off-by: Mike Day --- xen/arch/x86/setup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index f070b6303e..5131250cbb 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -475,13 +475,14 @@ void __init __start_xen(multiboot_info_t *mbi) { static char dom0_cmdline[MAX_GUEST_CMDLINE]; - /* Skip past the image name. */ + /* Skip past the image name and copy to a local buffer. */ while ( *cmdline == ' ' ) cmdline++; if ( (cmdline = strchr(cmdline, ' ')) != NULL ) + { while ( *cmdline == ' ' ) cmdline++; + strcpy(dom0_cmdline, cmdline); + } - /* Copy the command line to a local buffer. */ - strcpy(dom0_cmdline, cmdline); cmdline = dom0_cmdline; /* Append any extra parameters. */ -- 2.30.2